package utility;


public class Addprefix 
{
	public static String addPrefix(String buffer,String prefix)
	{	
		StringBuffer result = new StringBuffer();
		String splitbuffer[] =buffer.split("\t");
		for(int i=0;i<splitbuffer.length;i++)
		{
			if((prefix.length()>0 || !prefix.equals("null")))
				if(!splitbuffer[i].contains("."))
						result.append(prefix+"."+splitbuffer[i]+"\t");
			else
				result.append(splitbuffer[i]+"\t");
		}
		return result.toString();
	}
	
	public static String removerefix(String buffer)
	{
		String splitString[] = buffer.split("\t");
		StringBuffer result = new StringBuffer();
		for(int i=0;i<splitString.length;i++)
		{
			if(splitString[i].indexOf(".")!=-1)
			{	
				String splitString1 = splitString[i].substring(splitString[i].indexOf(".")+1,splitString[i].length());
				result.append(splitString1+"\t");
			}	
			else
			{
		    	 result.append(splitString[i]+"\t");
			}

		}
		return result.toString();
	}
}
